package com.ht.WeNas.utils;

import cn.hutool.core.thread.ThreadUtil;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

public class MyThreadPool {
    private static final ExecutorService service = 
            ThreadUtil.newExecutor(20, 1024, 1024);
    
    public static <T> Future<T> execAsync(Callable<T> callable) {
        return service.submit(callable);
    }

    public static void execAsync(Runnable runnable) {
        service.submit(runnable);
    }
}
